package com.situ.springboot.controller;

import com.situ.springboot.annotation.MyLog;
import com.situ.springboot.pojo.Type;
import com.situ.springboot.pojo.query.TypeQuery;
import com.situ.springboot.service.ITypeService;
import com.situ.springboot.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/type")
public class TypeController {

    @Autowired
    private ITypeService typeService;

    @RequestMapping("/selectAll")
    public List<Type> selectAll() {
        return typeService.selectAll();
    }

    @MyLog
    @RequestMapping("/selectByPage")
    public PageResult<Type> selectByPage(TypeQuery typeQuery) {
        return typeService.selectByPage(typeQuery);
    }
}
